Component({
    properties: {
        defaultType: {
            type: [ Number, Object, String ]
        }
    },
    data: {
        radio: 0
    },
    observers: {
        defaultType: function() {
            this.setData({
                radio: this.data.defaultType
            });
        }
    },
    methods: {
        showPopup: function() {
            this.setData({
                show: !this.data.show
            });
        },
        changeType: function(t) {
            this.setData({
                radio: t.detail
            });
        },
        onClick: function(t) {
            var a = t.currentTarget.dataset.name;
            this.setData({
                radio: a
            });
        },
        confirmType: function() {
            this.showPopup(), this.triggerEvent("confirmType", this.data.radio);
        }
    }
});